#include <bits/stdc++.h>

using namespace std;
const int maxn=200010;
int t[maxn];
int main_53_2()
{
    int n,m,k,ti,ci,qm;
    memset(t,0,sizeof(t));
    scanf("%d%d%d",&n,&m,&k);
    for (int i=0;i<n ;++i )
    {
        scanf("%d%d",&ti,&ci);
        int tl=max(0,ti-k-ci+1);
        int tr=max(0,ti-k);
        ++t[tl];
        --t[tr+1];
    }
    for (int i=1;i<=maxn ;++i )
    {
        t[i]+=t[i-1];
    }
    for (int i=0;i<m ;++i )
    {
        scanf("%d",&qm);
        printf("%d\n",t[qm]);
    }
    return 0;
}
